ListNode* removeDuplicateNodes(ListNode* head) {
    ListNode *pre = head;
    while(pre)
    {
        ListNode *cur = pre;
        while(cur->next)
        {
            if(cur->next->val == pre->val)
                cur->next = cur->next->next;
            else
                cur = cur->next;
        }
        pre = pre->next;
    }
    return head;
}